import sys
import qss_rc
import os
import getpath
from PySide6 import QtWidgets, QtCore
from PySide6.QtGui import QPalette,QColor
def qingyun_style(a):
    # f=open("qss/lightblue.css", "r") 
    # f=open("qss/blacksoft.css", "r") 
    f=open(os.path.join(getpath.getpath(),"qss","blacksoft.css"), "r") 
    _style = f.read()
    # print(_style)
    paletteColor=_style[20:20+7]
    # print(paletteColor)
    a.setPalette(QPalette(QColor(paletteColor)));
    a.setStyleSheet(_style);
def github_style(a):
    # with open("qss/ManjaroMix.qss", "r") as f:
    # with open("qss/Ubuntu.qss", "r") as f:
    # with open("qss/NeonButtons.qss", "r") as f:
    f=open(os.path.join(getpath.getpath(),"qss","MaterialDark.qss"), "r")
    # with open("qss/AMOLED.qss", "r") as f:
    # with open("qss/ConsoleStyle.qss", "r") as f:
    # f=open("qss/MacOS.qss", "r")
    # f=open("qss/ElegantDark.qss", "r")
    a.setStyleSheet(f.read());
def main():
    from mainw import MainW
    a=QtWidgets.QApplication([''])
    qingyun_style(a)
    a.setQuitOnLastWindowClosed(True)
    m=MainW()
    m.show()
    sys.exit(a.exec())
if __name__=="__main__":
    main()
    #testlink()